package top.springcloud.customer.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.springcloud.customer.entity.Customer;
import top.springcloud.customer.mapper.CustomerMapper;
import top.springcloud.customer.service.CustomerService;


/**
 * @ClassName CustomerServiceImpl
 * @Description TODO
 * @Author 维康
 * @Date 2018/8/13 17:31
 * @Version 1.0
 **/
@Service("customerService")
public class CustomerServiceImpl  implements CustomerService {


    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private CustomerMapper customerMapper;

    @Override
    public Customer getCustomerById(Integer customerId) {
        logger.info("查询用户：入参 customerid="+customerId);
        Customer customer = customerMapper.selectById(customerId);
        logger.info("查询用户：出参 = "+customer);
        return customer;
    }

    @Override
    public Customer saveCustomer(Customer customer) {
        /*if(customer.getCustomerId()!=null){
            baseMapper.updateById(customer);
        }else{
            baseMapper.insert(customer);
        }
        logger.info("saveCustomer: "+customer);
        return customer;*/
        return null;
    }
}
